#ifndef __HAL_AUDIO_H
#define __HAL_AUDIO_H

#include <stdio.h>
#include "t_types.h"

#define HAL_AUDIO_CHAN_NUM 1
//#define HAL_AUDIO_AUDIO_CAPTURE_DEVICE		"/dev/snd/pcmC0D0c"
#define HAL_AUDIO_CAPTURE_DEVICE "default"
#define HAL_AUDIO_MIXER_DEVICE "/dev/snd/controlC0"

typedef struct _HAL_AUDIO_PARAM_S
{
	T_INT32 s32ChnTotal;
	T_INT32 s32ChnChoose; // if mono, choose left or right channel
	T_INT32 s32Freq;
	T_INT32 s32Bits;
	T_INT32 s32SampleRate;
	T_INT32 s32Bitrate;
} HAL_AUDIO_PARAM_S;

typedef struct _HAL_AUDIO_CAPTURE_FRAME_S
{
	T_INT8 s8Buf;
	T_INT32 s32Len;
	T_UINT32 u32Timestamp; // ms
} HAL_AUDIO_CAPTURE_FRAME_S;

T_INT32 HAL_AUDIO_Init(void);
T_INT32 HAL_AUDIO_DeInit(void);
T_INT32 HAL_AUDIO_CaptureSetCallback(T_CALLBACK fnCb);
T_INT32 HAL_AUDIO_CaptureSetParam(HAL_AUDIO_PARAM_S *pParam);

#endif